package top.chenfu1201.clientApi.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.chenfu1201.clientApi.mns.FanoutExchangeProvider;
import top.chenfu1201.clientApi.mns.DirectExchangeProvider;

@RestController
@RequestMapping("/mns")
public class MnsController {

    @Autowired
    private DirectExchangeProvider directExchangeProvider;

    @Autowired
    private FanoutExchangeProvider fanoutExchangeProvider;

    @PostMapping("/send")
    public void send(String msg) {
        this.directExchangeProvider.sendMsg(msg);
    }

    @PostMapping("/sendFanout")
    public void sendFanout(String msg) {
        this.fanoutExchangeProvider.sendMsg(msg);
    }

}
